﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="3-8.aspx.cs" Inherits="计科2111林开心06._3_8" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
        <div>
        </div>
        <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataKeyNames="cid" DataSourceID="SqlDataSource1">
            <Columns>
                <asp:BoundField DataField="cid" HeaderText="cid" ReadOnly="True" SortExpression="cid" />
                <asp:BoundField DataField="cname" HeaderText="cname" SortExpression="cname" />
                <asp:BoundField DataField="cTime" HeaderText="cTime" SortExpression="cTime" />
                <asp:BoundField DataField="cDes" HeaderText="cDes" SortExpression="cDes" />
                <asp:CommandField HeaderText="选择" ShowHeader="True" ShowSelectButton="True" />
            </Columns>
        </asp:GridView>
        <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:StuInfoConnectionString %>" SelectCommand="SELECT * FROM [Course]"></asp:SqlDataSource>
        <asp:GridView ID="GridView2" runat="server" AutoGenerateColumns="False" DataSourceID="LinqDataSource1">
            <Columns>
                <asp:BoundField DataField="id" HeaderText="id" ReadOnly="True" SortExpression="id" />
                <asp:BoundField DataField="name" HeaderText="name" ReadOnly="True" SortExpression="name" />
                <asp:BoundField DataField="cid" HeaderText="cid" ReadOnly="True" SortExpression="cid" />
                <asp:BoundField DataField="score" HeaderText="score" ReadOnly="True" SortExpression="score" />
                <asp:BoundField DataField="sex" HeaderText="sex" ReadOnly="True" SortExpression="sex" />
            </Columns>
        </asp:GridView>
        <asp:LinqDataSource ID="LinqDataSource1" runat="server" ContextTypeName="计科2111林开心06.StruInfoDataContext" EntityTypeName="" Select="new (id, name, cid, score, sex)" TableName="Studnet" Where="cid == @cid">
            <WhereParameters>
                <asp:ControlParameter ControlID="GridView1" DefaultValue="1" Name="cid" PropertyName="SelectedValue" Type="String" />
            </WhereParameters>
        </asp:LinqDataSource>
    </form>
</body>
</html>
